package com.lqian.simplestructure.recursive;

/**
 * 返回第n个位置的数
 *
 *  1 1 2 3 5 8 13
 */
public class TestFibonacci {
    public static void main(String[] args) {
        System.out.println(Fibonacci(5));
    }

    public static int Fibonacci(int num){
        if (num == 1 || num == 2){
            return 1;
        }else {
            return Fibonacci(num-1) + Fibonacci(num-2);
        }
    }

}
